package com.lollipop.rabbitmqspringboot.consumer;

import com.lollipop.rabbitmqspringboot.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author: Lollipop
 * @Date: 2021-10-18 20:48
 * @Description: 发布确认模式-消息消费者
 */
@Component
@Slf4j
public class ConfirmQueueConsumer {
    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public void receiveConfirmMessage(Message message) {
        String msg = new String(message.getBody());
        log.info("接收到的消息：{}", msg);
    }
}
